<script>
	export default {
		globalData : {
			appName: uni.getStorageSync('serverInfo').app_name || 'AsiaShort',
			appLiteName: uni.getStorageSync('serverInfo').app_lite_name || '点点',
			customTel: uni.getStorageSync('serverInfo').app_custom_tel,
			version: '1.0.0',
			appLogo : uni.getStorageSync('serverInfo').imagePreFix_url + uni.getStorageSync('serverInfo').app_logo || 'https://shortqiniucn.aikm.cn/app/logo.png',
			// 本地-生产环境配置
			domain: 'http://api.short.cc/',
			language : {}
		},
		onLaunch: function() {
			console.log('1App onLaunch')
			this.setLanguage()
		},
		onShow: function() {
			console.log('22App Show')
		},
		onHide: function() {
			console.log('33App Hide')
		},
		methods: {			
			setLanguage(value) {
				// 在此设置默认语言，目前是chinese
				const defaultLanguage = uni.getStorageSync('language') || value || 'chinese';
				
				let languageData;
				
				switch(defaultLanguage) {
					
					case 'english' : 
						languageData = require('./language/english.json');
					break;
					
					case 'chinese' : 
						languageData = require('./language/chinese.json');
					break;
					
					default:
						languageData = require('./language/chinese.json');
					break;
				}
				
				this.globalData.language = languageData;
			},
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import '@/static/tcq_theme.css';
	@import "colorui/main.css";
	@import "colorui/icon.css";
	@import "static/css/index-app.css";
	
	page {
	  background-color: #ffffff; /* 或者使用 rgb(255, 255, 255) */
	}
	
</style>
